
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <cmath>
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/imu.hpp>
#include <sensor_msgs/msg/point_cloud2.h>

#include <eigen3/Eigen/Dense>
#include <mutex>
#include <queue>
#include "aloam_velodyne/common.h"
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/common/common.h>
#include <pcl/common/transforms.h>


class ImuPreintegration
{
    public:
    std::vector<double> rot_x;
    std::vector<double> rot_y;
    std::vector<double> rot_z;
    std::vector<double> time;
    int latest;
    int max_size;
    ImuPreintegration(int max_size);
    bool preintegrate(std::deque<sensor_msgs::msg::Imu> &imubuf);
    bool findRotation(double timepoint, double &x, double &y, double &z);
    bool findPosition(double timepoint, double &x, double &y, double &z);
	bool transformPointCloud(sensor_msgs::msg::PointCloud2 &pcl);
	bool transformPointCloud(pcl::PointCloud<PointIn> &pcloud);
};

